package cn.sitedev.simple;

/**
 * @author qchen
 * @description
 * @date 2020/9/16 6:36
 */
public class simpleTest {
    public static void resize(Rectangle rectangle) {
        while (rectangle.getWidth() > rectangle.getHeight()) {
            rectangle.setHeight(rectangle.getHeight() + 1);
            System.out.println("width: " + rectangle.getWidth() + ", height: " + rectangle.getHeight());
        }
        System.out.println("Resize End, width: " + rectangle.getWidth() + ", height: " + rectangle.getHeight());
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        rectangle.setWidth(20);
        rectangle.setHeight(10);
        resize(rectangle);
        System.out.println("==============");
        Square square = new Square();
        square.setLength(10);
        resize(square);
    }
}
